//
//  QRCodeViewController.m
//  扫一扫添加好友
//
//  Created by 企点点 on 15/8/13.
//  Copyright (c) 2015年 企点点. All rights reserved.
//

#import "QRCodeViewController.h"

@interface QRCodeViewController ()

@property (nonatomic, strong)UIWebView *webView;
@property (nonatomic, strong)UIButton *button;

@end

@implementation QRCodeViewController

- (UIButton *)button{
    if (!_button) {
        self.button = [UIButton buttonWithType:UIButtonTypeSystem];
        _button.frame = CGRectMake(10, 20, 100, 50);
        [_button addTarget:self action:@selector(handleBnAction:) forControlEvents:UIControlEventTouchUpInside];
        [_button setTitle:@"取消" forState:UIControlStateNormal];
        [self.view addSubview:_button];
    }
    return _button;
}

- (UIWebView *)webView{
    if (!_webView) {
        self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 64, self.view.bounds.size.width, self.view.bounds.size.height)];
        [self.view addSubview:_webView];
    }
    return _webView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    NSURL *url = [NSURL URLWithString:self.strUrl];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [self.webView loadRequest:request];
}

- (void)handleBnAction:(UIButton *)sender{
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
